package main

import (
	"fmt"
	"strconv"
)

func main() {
	num := 100
	str := strconv.Itoa(num)
	fmt.Printf("type : %T value:%v\n", str, str)

	str1 := "110"
	str2 := "s100"
	num1, err := strconv.Atoi(str1)
	if err != nil {
		fmt.Printf("%v 转换失败！", str1)
	}else {
		fmt.Printf("type:%T value:%#v\n", num1, num1)
	}

	num2, err := strconv.Atoi(str2)
	if err != nil {
		fmt.Printf("%v 转换失败！", str2)
	}else {
		fmt.Printf("type:%T value:%#v\n", num2, num2)
	}

	boo1 , err := strconv.ParseBool(str1)
	if err != nil {
		fmt.Printf("str1: %v\n", err)
	}else {
		fmt.Println(boo1)
	}
	str2 = "t"
	boo2, err := strconv.ParseBool(str2)
	if err != nil {
		fmt.Printf("str2: %v\n", err)
	} else {
		fmt.Println(boo2)
	}
}
